testDict = {'apple': 'red', 'banana': 'yellow', 'pear': 'green'}

for i, (fruit, color) in enumerate(testDict.items()):
    # fruit 和 color 一定要加括号，否则会报错
    print(i, fruit, color)
